package com.kevin.constant;

import java.io.Serializable;

public enum SerialType {

    SERIAL_JSON((byte)1),
    SERIAL_JAVA((byte)2)
    ;

    private byte code;

    SerialType(byte code) {
        this.code = code;
    }

    public byte getSerialType(){
        return this.code;
    }


    public static Serializable findByCode(byte code){
        for (SerialType serialType : SerialType.values()) {
            if(serialType.code==code) return serialType;
        }
        return null;
    }

}
